::
::    >>>  Windows Command-Line Script Framework  <<<
::
::      [Version]     v0.0.5  (2015-5-27)
::
::      [Based on]    cmd.exe  cscript.exe  mshta.exe
::
::          (C)2012-2015  shiy2008@gmail.com
::
@  echo off  &  cls  &  prompt $$$S  &  pushd "%~dp0"
if /I "%~1" EQU "/Debug" (
    echo on
	shift
)

:: ----- Environment Initialization ----- ::
if "%Processor_Architecture%" NEQ "AMD64" (
	set _System32_=%SystemRoot%\system32
) else (
	set _System32_=%SystemRoot%\SysWOW64
)
set _Line_=echo ___________  ^&  echo.  ^&  echo.
set _LH_=echo ^^^|

goto Main

:: ----- Global Method ----- ::

:Exit
if "%~1" NEQ "" (
    set iError=%~1
) else (
	set iError=%ErrorLevel%
)
if %iError% NEQ 0 (
	%_Line_%  &  pause
)
exit %iError%

:AdminRun
bcdedit > nul
if "%ErrorLevel%" EQU "0" (
	%~1
) else (
	%_LH_%
	%_LH_%  You may need to press [Ctrl ^+ C] to exit This Tool for reasons of:
	%_LH_%
	%_LH_%    1. the Administrator Account of Current Windows OS has been renamed
	%_LH_%
	%_LH_%    2. not knowing the Password of Administrator Account
	%_LH_%
	%_LH_%  And then, you need to run This Tool in cmd.exe ^(Run as Administrator^)
	%_LH_%  again.
	%_LH_%
	%_Line_%
	runas /savecred /user:"Administrator@%UserDomain%" "%~1"
)
exit /B %ErrorLevel%

:WiFi_ID
for /F "usebackq delims=: tokens=1*" %%i in (`netsh wlan show all ^| find /i "SSID"`) do (
    set _Return_=%%j
    exit /B 0
)

:LAN_IP
for /F "usebackq delims=: tokens=1*" %%i in (`ipconfig ^| find /i "IPv4"`) do (
    set _Return_=%%j
    exit /B 0
)


:: ----- Main Logic ----- ::
:Main
